/*
 * @Description: 系统管理-级别变更理由字典api文件
 * @FilePath: \hk-marketing-crm\src\api\system\levelChangesReasonDic\index.ts
 * @Date: 2023-09-21 17:37:47
 * @LastEditTime: 2023-09-22 10:01:13
 */

import axiosRequest from '/@/utils/request';

/**
 * 字典管理接口接口集合
 * @method addRule 添加规则
 * @method updateRule 修改规则
 * @method delRule 删除规则
 * @method queryListByOriginalAndNewLevel 根据原级别和新级别查询变更理由
 * @method queryListRule 分页项目级别变更规则
 */
export function useLevelChangesReasonDicApi() {
  return {
    // 添加规则
    addRule: async (params: object) => {
      const res = await axiosRequest({
        url: '/api/ProjectLevelChange/addRule',
        method: 'post',
        data: params,
      });
      return res;
    },
    // 修改规则
    updateRule: async (params: object) => {
      const res = await axiosRequest({
        url: '/api/ProjectLevelChange/updateRule',
        method: 'post',
        data: params,
      });
      return res;
    },
    // 删除规则
    delRule: async (params: { 'id': string }) => {
      const res = await axiosRequest({
        url: '/api/ProjectLevelChange/delRule',
        method: 'get',
        params,
      });
      return res;
    },
    // 根据原级别和新级别查询变更理由
    queryListByOriginalAndNewLevel: async (params: object) => {
      const res = await axiosRequest({
        url: '/api/ProjectLevelChange/queryListByOriginalAndNewLevel',
        method: 'post',
        data: params,
      });
      return res;
    },
    // 分页项目级别变更规则
    queryListRule: async (params: object) => {
      const res = await axiosRequest({
        url: '/api/ProjectLevelChange/queryListRule',
        method: 'post',
        data: params,
      });
      return res;
    }
  };
}
